Skip to content

fix: load unprefixed standalone Qwen MTP weights - #6

Merged
Satchitananda merged 6 commits into
bench/qwen38-comparisonfrom
fix/qwen-mtp-standalone-weights
Sep 6, 2026
Merged

Satchitananda merged 6 commits into
bench/qwen38-comparisonfrom
fix/qwen-mtp-standalone-weights

Conversation

@Satchitananda

@Satchitananda Satchitananda commented Sep 6, 2026 •

Copy link
Copy Markdown
Owner

Intent and behavior

Converted standalone Qwen MTP checkpoints may store predictor tensors at the root. The loader previously discarded them because it accepted only mtp.* keys, causing missing-parameter failures.

Normalize bare keys only for registered standalone checkpoints without existing mtp.* keys. Both text and VLM loaders share the normalization. Full-model filtering, prefixed checkpoints, converted norms, quantization metadata, and strict weight validation retain their behavior. This does not change the MTP algorithm or enable production MTP.

Validation and review

  • Synthetic quantized safetensors reproduced the failure for bare text/VLM checkpoints before the fix, then passed for bare and prefixed layouts. Separate text/VLM cases reject bare full-target weights.
  • Retained full gate on runtime commit 600821e: 611 XCTest passes, one skip; 835 Swift Testing passes. The pre-existing disabled three-test ConstraintCachingTests suite is explicitly recorded.
  • Proof used a fresh scratch build, matching Metal library, and serial MLX_ENABLE_TF32=0 tests. Tolerances were unchanged; performance measurements use their separately recorded production precision setting.
  • Changed Swift files pass swift-format lint and whitespace checks. The pre-commit wrapper is not installed. Documentation and merge-history updates leave the tested runtime unchanged.
  • Focused weight-loading, registration, coverage, and documentation review found no remaining blocker.

Conflict resolution — 2026-09-07

The base branch was rebased to 25d178a with an identical file tree. Merge commit 7e0e1be incorporates that history and resolves all six conflicts while retaining exactly the prior PR tree (4ff00d706d7f6cf39d0530a5ee1c05cba66a0533). Runtime sources, tests, and the package manifest also remain identical to the fully tested 600821e runtime.

Fresh verification reran Qwen35MTPRegistrationTests against the retained unchanged-runtime build: four tests / eight parameter cases passed, including bare and prefixed text/VLM checkpoints and rejection of full-target weights. Command: MLX_ENABLE_TF32=0 swift test --scratch-path /private/tmp/qwen38-lm-clean --skip-build --no-parallel --filter Qwen35MTPRegistrationTests. All four relevant Swift files passed xcrun swift-format lint --strict; whitespace and tree-equality checks passed. No benchmark was restarted.

Dependencies and documentation

Merge runtime #5 first, then this PR. Catalog #135 consumes this branch. QWEN38_INTEGRATION.md documents both layouts, text/VLM registration, fixture proof, and validation limits; README and CONTRIBUTING link the correct fork instructions.

Risk and privacy

The registration guard prevents full-target parameters from being treated as MTP weights. Fixtures use unique temporary synthetic checkpoints. No new network, telemetry, persistence, permission, signing, or production-data behavior is introduced. Production MTP remains disabled.

The owner stopped local benchmarks for a later restart. The completed native-MTP microbenchmark is retained, while the full model-replacement comparison remains unfinished; this PR makes no promotion claim.

@Satchitananda
Satchitananda marked this pull request as ready for review September 6, 2026 19:05
@Satchitananda
Satchitananda merged commit 7cb14dc into main Sep 6, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant